package com.sgb.alimaplibrary;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.OnLifecycleEvent;


/**
 * 于activity或者fragment的
 * 生命周期綁定
 */
public interface IPresenter extends LifecycleObserver {

    @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
    void onLifecycleChanged(LifecycleOwner owner,Lifecycle.Event event);

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    void onResume();
    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    void onPause();
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    void onDestroy();
}
